package com.bookcity.front.webfront.domain;

import com.bookcity.front.webfront.vo.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 书籍对象 book
 * 
 * @author ruoyi
 * @date 2023-05-06
 */
public class Book extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 编号 */
    @Excel(name = "编号")
    private Long id;

    /** 书名 */
    @Excel(name = "书名")
    private String bookname;

    /** 导读 */
    @Excel(name = "导读")
    private String description;

    /** 是否完结 */
    @Excel(name = "是否完结")
    private Boolean isfinish;

    /** 作者 */
    //@Excel(name = "作者")
    private Long authorid;

    /** 类型 */
    //@Excel(name = "类型")
    private Long typeid;

    /** 购买次数 */
    @Excel(name = "购买次数")
    private Integer buynums;

    /** 阅读次数 */
    @Excel(name = "阅读次数")
    private Integer readcount;

    /** 加入时间 */
    @JsonFormat(pattern = "yyyy-MM-dd H:m:s")
    @Excel(name = "加入时间", width = 30, dateFormat = "yyyy-MM-dd H:m:s")
    private Date addtime;

    /** 收藏次数 */
    @Excel(name = "收藏次数")
    private Integer tofavcount;

    /** 封面图片地址 */
    @Excel(name = "封面图片地址")
    private String coverimg;

    /** 封面图片地址 */
    @Excel(name = "作者")
    private String authorname;
    @Excel(name = "类型")
    private String typename;

    private List<Label> labelsList=new ArrayList<>(0);

    public List<Label> getLabelsList() {
        return labelsList;
    }

    public void setLabelsList(List<Label> labelsList) {
        this.labelsList = labelsList;
    }
//    @Excel(name = "标签")
//    private String labels;
//
//    private long[] booklabelsList=new long[0];

//    public long[] getBooklabelsList() {
//        return booklabelsList;
//    }
//
//    public void setBooklabelsList(long[] booklabelsList) {
//        this.booklabelsList = booklabelsList;
//    }

//    public String getLabels() {
//        return labels;
//    }
//
//    public void setLabels(String labels) {
//        this.labels = labels;
//    }


    public String getAuthorname() {
        return authorname;
    }

    public void setAuthorname(String authorname) {
        this.authorname = authorname;
    }

    public String getTypename() {
        return typename;
    }

    public void setTypename(String typename) {
        this.typename = typename;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setBookname(String bookname) 
    {
        this.bookname = bookname;
    }

    public String getBookname() 
    {
        return bookname;
    }
    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }
    public void setIsfinish(Boolean isfinish) 
    {
        this.isfinish = isfinish;
    }

    public Boolean getIsfinish() 
    {
        return isfinish;
    }
    public void setAuthorid(Long authorid) 
    {
        this.authorid = authorid;
    }

    public Long getAuthorid() 
    {
        return authorid;
    }
    public void setTypeid(Long typeid) 
    {
        this.typeid = typeid;
    }

    public Long getTypeid() 
    {
        return typeid;
    }
    public void setBuynums(Integer buynums) 
    {
        this.buynums = buynums;
    }

    public Integer getBuynums() 
    {
        return buynums;
    }
    public void setReadcount(Integer readcount) 
    {
        this.readcount = readcount;
    }

    public Integer getReadcount() 
    {
        return readcount;
    }
    public void setAddtime(Date addtime) 
    {
        this.addtime = addtime;
    }

    public Date getAddtime() 
    {
        return addtime;
    }
    public void setTofavcount(Integer tofavcount) 
    {
        this.tofavcount = tofavcount;
    }

    public Integer getTofavcount() 
    {
        return tofavcount;
    }
    public void setCoverimg(String coverimg) 
    {
        this.coverimg = coverimg;
    }

    public String getCoverimg() 
    {
        return coverimg;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("bookname", getBookname())
            .append("description", getDescription())
            .append("isfinish", getIsfinish())
            .append("authorid", getAuthorid())
            .append("typeid", getTypeid())
            .append("buynums", getBuynums())
            .append("readcount", getReadcount())
            .append("addtime", getAddtime())
            .append("tofavcount", getTofavcount())
            .append("coverimg", getCoverimg())
            .toString();
    }
}
